package com.rjpacket.MyUEnjoy.adapters;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import com.rjpacket.MyUEnjoy.fragments.ImportStoreFragment;
import com.rjpacket.MyUEnjoy.fragments.NormalStoreFragment;

/**
 * Created by aaa on 15-1-23.
 */
public class StoreAdapter extends FragmentPagerAdapter{
    public StoreAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        Fragment fragment = null;
        Bundle bundle = new Bundle();
        switch(position){
            case 0:
                fragment = new ImportStoreFragment();
                bundle.putInt("position",position);
                break;
            case 1:
                fragment = new NormalStoreFragment();
                bundle.putInt("position",position);
                break;
        }
        if (fragment != null) {
            fragment.setArguments(bundle);
        }
        return fragment;
    }

    @Override
    public int getCount() {
        return 2;
    }
}
